$.jQTouch({
	icon: 'images/icon.png',
	addGlossToIcon: false,
	startupScreen: 'images/splash.png',
	statusBar: 'default'
	});
	
var turn = false;
var leftLimit = 600;
var rightLimit= 100;
var startBird1= 100;
var startBird2= 600;

$(function() {
	setTimeout("gameScreenAppeared()",1000);
	//setInterval("moveBird()", 10);
	//$("#character").bind("pageAnimationStart",gameScreenAppeared);
});


function gameScreenAppeared() {
	setInterval("moveBird()", 50);
}


function moveBird(){
	if(turn == false){
		$("#bird1").removeClass("hideMe");
		var left1 = parseInt($("#bird1").css("left"));
		left1 = left1 + 10;
		$("#bird1").css("left", left1);
	
		if(left1 > leftLimit) {
			$("#bird1").addClass("hideMe");
			$("#bird1").css("left", startBird1);
			turn=true;
		}  
	} else {
		$("#bird2").removeClass("hideMe");
		var left2 = parseInt($("#bird2").css("left"));
		left2 = left2 - 10;
		$("#bird2").css("left", left2);
	
		if(left2 < rightLimit) {
			$("#bird2").addClass("hideMe");
			$("#bird2").css("left", startBird2);
			turn=false;
			}
	} 
		
	/*var left2 = parseInt($("#bird2").css("left"));

	if(turn == false){
		$("#bird1").removeClass("hideMe");
		
		left1 = left1 + 10;
		$("#bird1").css("left", left1);
		
		if(left1 > leftLimit) {
			$("#bird1").addClass("hideMe");
			$("#bird1").css("left", startBird1);

			turn = true;
		}
	} else {
		$("#bird2").removeClass("hideMe");
		
		left2 = left2 - 1;
		$("#bird2").css("left", left2);
	
	
		if(left2 < rightLimit) {
			$("#bird2").addClass("hideMe");
			$("#bird2").css("left", startBird2);

			turn = false;
		}
		}

}*/
}
